/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package All.connectionDB;

/**
 *
 * @author NGUYEN DANG
 */
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import javax.naming.NamingException;

public class ConnectionService {
	public static Connection getConnection() throws NamingException, SQLException, ClassNotFoundException 
        {
                String driver = "com.mysql.jdbc.Driver";
                String url = "jdbc:mysql://localhost:3306/TCMN?useUnicode=yes&characterEncoding=UTF-8";
                String username = "root";
                String password = "123";
                Class.forName(driver);
                Connection con ;
                con = DriverManager.getConnection(url,username,password);
		return con;
	}
}
